from selenium.webdriver.common.by import By

from base import Base
class Page(Base):
    def diankuang(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().text("搜商品名称 作者 出版社 ISBN")')
        ele=self.find_ele(loc)
        return ele
    # 输入
    def shu(self):
        loc=(By.CLASS_NAME,'android.widget.EditText')
        ele=self.find_ele(loc)
        return ele
    # 按钮
    def anniu(self):
        loc=(By.ID,'com.kongfz.app:id/tvSearch')
        ele=self.find_ele(loc)
        return ele
    # 点击图片
    def dianjitupian(self):
        loc=(By.XPATH,'(//android.widget.ImageView[@resource-id="com.kongfz.app:id/ivPic"])[3]')
        ele=self.find_ele(loc)
        return ele
    # 购物车
    def jiarugouwuche(self):
        loc=(By.XPATH,'//android.widget.TextView[@resource-id="com.kongfz.app:id/tvAddCart1"]')
        ele=self.find_ele(loc)
        return ele
    # 返回按钮
    def fanhui(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().className("android.view.View").instance(7)')
        ele=self.find_ele(loc)
        return ele
    # 断言1
    def duanyan(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="查看全部"]')
        ele=self.find_ele(loc)
        return ele
    # 断言2
    def duanyan1(self):
        loc=(By.XPATH,'//android.widget.TextView[@resource-id="com.kongfz.app:id/tvName" and @text="综合"]')
        ele=self.find_ele(loc)
        return ele